#ifndef _PLANE_H_
#define _PLANE_H_

#include <cocos2d.h>
#include "Weapon.h"
#include "BaseObject.h"
#include "HealthBar.h"
#include "BaseStrategy.h"
#include "PlayerHealthBar.h"

USING_NS_CC;

//typedef void (CCObject::*SEL_HealthCallback)(CCObject*, int min, int max);


class PlayerPlane : public BaseObject
{
public:
	PlayerPlane(void);
	~PlayerPlane(void);

	virtual bool init();
	virtual void onEnter();
	virtual void onExit();
	virtual void shoot( Bullet* bullet );
	virtual void onShot(Bullet* bullet);

	//CC_SYNTHESIZE_RETAIN(Weapon*, _weapon, Weapon);
	CC_SYNTHESIZE_RETAIN(BaseStrategy*, _strategy, Strategy);
	CC_SYNTHESIZE_RETAIN(BaseStrategy*, _rocketStrategy, RocketStrangtegy);
	CC_SYNTHESIZE_RETAIN(CCArray*, _listSupportedWeaponKey, SupportedWeaponKeys);
	CC_SYNTHESIZE_RETAIN(PlayerHealthBar*, _healthBar, HealthBar);
	CC_PROPERTY(int, _health, Health);
	CC_PROPERTY(int, _maxHealth, MaxHealth);
	CC_PROPERTY(int, _weaponLevel, WeaponLevel);
	CC_SYNTHESIZE(bool, _isProtected, IsProtected);

/**
Protect bound extract
*/
	CC_SYNTHESIZE(CCSize, _protectBoundBox, ProtectBoundBox);
	CREATE_FUNC(PlayerPlane);

	void onShooting(float dt);

	void startShoot(CCNode* sender);

};



#endif // !_PLANE_H_
